<template>
  <div>
    <el-dialog
      title="查看图片"
      :visible.sync="dialogVisible"
      width="50%"
    >
      <el-image :src="url">
        <div slot="placeholder" class="image-slot">
          加载中<span class="dot">...</span>
        </div>
      </el-image>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="close()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'OpenImgDialog',
  data() {
    return {
      url: '',
      dialogVisible: false
    }
  },
  methods: {
    open(url) {
      this.dialogVisible = true
      this.url = decodeURIComponent(url)
    },
    close() {
      this.dialogVisible = false
    }
  }
}
</script>

<style scoped>

</style>
